// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdTreeNode
 */
public class AdTreeNodeDaoImpl
    extends org.tinaelle.server.domain.AdTreeNodeDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdTreeNodeDao#toAdTreeNodeDTO(org.tinaelle.server.domain.AdTreeNode)
     */
    public org.tinaelle.common.dto.AdTreeNodeDTO toAdTreeNodeDTO(final org.tinaelle.server.domain.AdTreeNode entity)
    {
        return super.toAdTreeNodeDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdTreeNode loadAdTreeNodeFromAdTreeNodeDTO(org.tinaelle.common.dto.AdTreeNodeDTO adTreeNodeDTO)
    {
        org.tinaelle.server.domain.AdTreeNode adTreeNode = this.load(adTreeNodeDTO.getAdTreeNodeId());
        if (adTreeNode == null)
        {
            adTreeNode = org.tinaelle.server.domain.AdTreeNode.Factory.newInstance();
        }
        return adTreeNode;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdTreeNodeDao#adTreeNodeDTOToEntity(org.tinaelle.common.dto.AdTreeNodeDTO)
     */
    public org.tinaelle.server.domain.AdTreeNode adTreeNodeDTOToEntity(org.tinaelle.common.dto.AdTreeNodeDTO adTreeNodeDTO)
    {
        org.tinaelle.server.domain.AdTreeNode entity = this.loadAdTreeNodeFromAdTreeNodeDTO(adTreeNodeDTO);
        this.adTreeNodeDTOToEntity(adTreeNodeDTO, entity, true);
        return entity;
    }
}